package cn.waqwb.test;

import cn.waqwb.pojo3.School;
import cn.waqwb.pojo3.Student;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Classname MyTest3
 * @Description TODO
 * @Date 2022/9/7 19:18
 * @Created by Administrator
 */
public class MyTest3 {
    @Test
    public void testConstructorArgs(){
        ApplicationContext ac = new ClassPathXmlApplicationContext("s03\\applicationContext.xml");
        School school = (School) ac.getBean("school");
        System.out.println(school);
    }

    @Test
    public void testConstructorIndex(){
        ApplicationContext ac = new ClassPathXmlApplicationContext("s03\\applicationContext.xml");
        Student student = (Student) ac.getBean("stu");
        System.out.println(student);
    }
    @Test
    public void testConstructorSequence(){
        ApplicationContext ac = new ClassPathXmlApplicationContext("s03\\applicationContext.xml");
        Student student = (Student) ac.getBean("stuSequence");
        System.out.println(student);
    }
}
